package STUDENT.TRINHQUANGXUANDUC.OPPS.CHANLE;

public class Models {
	public boolean isEven(NumberObject object) {
		if (object.getNumber() % 2 == 0) {
			return true;
		}
		return false;
	}

	public boolean isOdd(NumberObject object) {
		if (object.getNumber() % 2 != 0) {
			return true;
		}
		return false;
	}

	public boolean isPrime(NumberObject object) {
		boolean kq = false;
		for (int i = 0; i < object.getNumber(); i++) {
			if (object.getNumber() % 2 == 0) {
				kq = true;
			} else {
				kq = false;
			}
		}
		return kq;
	}

	public static boolean IsEven(NumberObject object) {
		if (object.getNumber() % 2 == 0) {
			return true;
		}
		return false;
	}

	public static boolean IsOdd(NumberObject object) {
		if (object.getNumber() % 2 != 0) {
			return true;
		}
		return false;
	}

	public static boolean IsPrime(NumberObject object) {
		boolean kq = false;
		for (int i = 0; i < object.getNumber(); i++) {
			if (object.getNumber() % 2 == 0) {
				kq = true;
			} else {
				kq = false;
			}
		}
		return kq;
	}

	public boolean equals(NumberObject object) {
		if (object.getNumber() == 1) {
			return true;
		}
		return false;
	}

	/**
	 * Phuong thuc chuyen doi Chuoi thanh kieu Int
	 * 
	 * @param value
	 * @return Tra ve ket qua chuyen doi kieu Integer
	 */
	public int parseInt(String value) {
		return Integer.parseInt(value);
	}
}
